<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>我的店铺</title>
    <link rel="stylesheet" th:href="@{/static/css/minireset.css}" />
    <link rel="stylesheet" th:href="@{/static/css/common.css}" />
    <link rel="stylesheet" th:href="@{/static/css/iconfont.css}" />
    <link rel="stylesheet" th:href="@{/static/css/index.css}" />
    <link rel="stylesheet" th:href="@{/static/css/swiper.min.css}" />
    <script language="JavaScript" th:src="@{/static/script/vue.js}"></script>
    <script language="JavaScript" th:src="@{/static/script/axios.min.js}"></script>
    <script language="JavaScript" th:src="@{/static/script/index.js}"></script>
    <script language="JavaScript" th:src="@{/static/script/backstage.js}"></script>
    <link rel="stylesheet" th:href="@{/static/css/cart.css}" />
    <link rel="stylesheet" th:href="@{/static/css/bookManger.css}" />
    <link rel="stylesheet" th:href="@{/static/css/orderManger.css}" />
</head>
<body>
<div id="app">
    <div class="topbar">
        <div class="w">
            <div class="topbar-right" th:unless="${session.loginuser==null}">
                <!--登录后风格-->
                <span>欢迎你<b th:text="${session.loginuser.getUser_name()}">张总</b></span>
                <a th:href="@{/page.do?operate=page&page=login}" class="register">注销</a>
                    <a  th:href="@{/Commodity.do}" class="register">返回</a>
                <a th:href="@{/cart.do}" class="cart iconfont icon-gouwuche">
                    购物车
                    <div class="cart-num" th:text="${session.loginuser.cart.getKind()}">0</div>
                </a>
            </div>
        </div>
    </div>
    <div class="header w">
        <a th:href="@{/page.do?operate=page&page=addCommodity}" class="commom">添加新商品</a>
    </div>

    <div class="books-list ">
        <div class="w">
            <div class="list">
                <div class="list-header">
                    <div class="title" th:text="${session.loginuser.user_name}"></div>
                    <div class="price-search">
                        <a th:unless="${session.state=='%%'}" th:href="@{/Commodity.do?operate=seller}" >查看全部商品</a>
                        <a th:if="${session.state=='%%'}" th:href="@{/Commodity.do?operate=seller&state=0}" >查看仓库</a>
                    </div>

                </div>
                <div class="list-content" id = "index_div">
                    <tr th:if="${#lists.isEmpty(session.goodslist)}">
                        <td colspan="4">无商品</td>
                    </tr>
                    <div href="" class="list-item" th:each="commodity : ${session.goodslist}" th:object="${commodity}">
                        <img th:src="@{|/static/uploads/*{commodity_IMG}|}" alt="">
                        <p th:text="|商品名:*{commodity_name}|">书名:活着</p>
                        <p th:text="|价格:￥*{price}|">价格:￥66.6</p>
                        <p th:text="|销量:*{saleCount}|">销量:230</p>
                        <p th:text="|库存:*{inventory}|">库存:1000</p>
                        <p th:if="*{state==2}">已被强制下架</p>
                        <p th:if="*{state==3}">待审核</p>
                        <p th:if="*{state==4}">上架申请被退回</p>
                        <button th:if="*{state==1}" th:onclick="|addware(*{commodity_ID},'0')|">下架</button>
                        <button th:if="*{state==0}" th:onclick="|addware(*{commodity_ID},'1')|">上架</button>
                        <button th:if="*{state==1}" th:onclick="|Delayware(*{commodity_ID},'0')|">延时1h下架</button>
                        <button th:if="*{state==0}" th:onclick="|Delayware(*{commodity_ID},'1')|">延时1h上架</button>
                        <button th:unless="${session.state=='%%'}" th:onclick="|delcommodity(*{commodity_ID})|">删除商品</button>
                        <button  th:onclick="|updatecommodity(*{commodity_ID})|">修改商品</button>
                    </div>
                </div>

            </div>
        </div>

    </div>


    <div class="list">
        <div class="w">
            <h1 class="commom">我的待出货订单</h1>
            <table>
                <thead>
                <tr>
                    <th>订单号</th>
                    <th>订单日期</th>
                    <th>订单金额</th>
                    <th>商品数量</th>
                    <th>订单状态</th>
                    <th>订单详情</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="order : ${session.shippedlist}" th:object="${order}">
                    <td th:text="*{order_No}">12354456895</td>
                    <td th:text="*{#dates.format(order_Date,'yyyy-MM-dd HH:mm:ss')}">2015.04.23</td>
                    <td th:text="*{order_Money}">90.00</td>
                    <td th:text="*{order_count}">88</td>
                    <td>
                        <button th:if="*{order_status==1}" th:onclick="|Shipped(*{order_ID})|">出货</button>
                       <p th:if="*{order_status==2}" class="send">等待买家到店取货</p>
                        <p th:if="*{order_status==3}">等待派送员接单</p>
                        <p th:if="*{order_status==4}">等待派送员送达</p>
                        <p th:if="*{order_status==5}">订单完成</p>
                    </td>
                    <td><a th:href="@{/order.do(operate='detail',order_ID = *{order_ID})}" >
                        查看详情
                    </a></td>
                </tr>

                </tbody>
            </table>

        </div>
    </div>


</div>
<script src="./static/script/swiper.min.js"></script>
<script>
    var swiper = new Swiper('.swiper-container', {
        autoplay: true,
        pagination: {
            el: '.swiper-pagination',
            dynamicBullets: true
        },
        navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev'
        }
    })
</script>
</body>
</html>